function [lh] = calbar(x,y,xl,yl)
% function to plot a calibration bar on the current figure, using the
% current axes. corner of the cal bar is at x and y, the length is xl, yl
%
h=gcf;
if(isempty(h) | ~ishandle(h))
    return;
end;
hold on
cbx = [x x x+xl];
cby = [y+yl y y];
lh = plot(cbx, cby, '-');
text(x+xl/2, y-yl*0.2, sprintf('%d', xl));
text(x-xl*0.2, y+yl/2, sprintf('%d', yl)); 
axis off;
return; % returns the line handles to the lines... if you want to modify them.

